package com.csdig.html.service.impl;

import com.csdig.html.dao.ForumPostDao;
import com.csdig.html.model.ForumPost;
import com.csdig.html.service.ForumPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author wei_jc
 * @since 1.0.0
 */
@Service
@Transactional
public class ForumPostServiceImpl implements ForumPostService {
    @Autowired
    private ForumPostDao forumPostDao;

    @Override
    public void saveForumPost(ForumPost vo) throws Exception {
        forumPostDao.add(vo);
    }

    @Override
    public List<ForumPost> listAll() throws Exception {
        return forumPostDao.listAll();
    }

    @Override
    public ForumPost getForumPost(int id) throws Exception {
        return forumPostDao.findById(id);
    }
}
